#include "DataAnalog.h"

myCDataAnalog::myCDataAnalog()
{

}

void myCDataAnalog::FreshData(float fData)
{
    if(m_bManualSet)    return;
    fData = m_fA0 + fData * m_fA1;
    float fPrecision = 0.00001f;
    switch(m_Format)
    {
        case 0: fPrecision = 0.5f;  break;
        case 1: fPrecision = 0.05f; break;
        case 2: fPrecision = 0.005f;    break;
        case 3: fPrecision = 0.0005f;   break;
        case 4: fPrecision = 0.00005f;  break;
    }
    if(fabs(fData - m_fData) >= fPrecision)
    {
        m_fData = fData;
    }
}
